package main

func twoSum(nums []int, n int) []int {
	m := make(map[int]int)
	for k, v := range nums {
		target := n - v
		if index, ok := m[target]; ok {
			return []int{index, k}
		}
		m[v] = k
	}
	return []int{}
}
